package com.column;
import java.io.*;
import java.io.File;
import java.io.FilenameFilter;

public class Main52 {
    private static String[] children;

    public static void main(String[] args) {
        File dir=new File("F:\\");
        FilenameFilter filter=new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".txt");
            }
        };
        String[] files=dir.list(filter);
        if(children==null){
            System.out.println("目录不存在或它不是一个目录");
        }
        else{
            for(int i=0;i<children.length;i++){
                File filename=new File(children[i]);
                System.out.println(filename.toString());
            }
        }
        }
    }

